package com.yixing.tech.common;

import lombok.Getter;

import java.util.Objects;

/**
 * 常量
 *
 * @author yixing tech
 * @since 1.0.0
 */
public interface CommonConstant {

    int NO = 0;

    int YES = 1;

    String KEY_AUTHORITIES = "authorities";

    String CONTENT_TYPE_JSON = "text/json;charset=utf-8";

    String CHARSET_UTF8 = "UTF-8";

    // 下面都是业务的

    /**
     * 库存
     */
    String STOCK_NAME = "6690d464634ce45c56c08921";

    /**
     * 出入库流水
     */
    String STOCK_FLOW = "66a2060998c09e6b8a77d7dd";

    /**
     * 存储规则
     */
    String STOCK_RULE = "668f70c6634ce45c56c0886f";
    /**
     * 存储规则
     */
    String MATERIAL_MIX_RULE = "6724308a34b46635dddf44b9";

    /**
     * 原材料入库
     */
    String RAW_MATERIAL_IN_STOCK = "66908e8c634ce45c56c08876";

    String RAW_MATERIAL_IN_STOCK_DETAIL = "66909188634ce45c56c08884";

    /**
     * 成品入库
     */
    String PRODUCTION_IN_STOCK = "669dc63998c09e6b8a77d4da";

    String PRODUCTION_IN_STOCK_DETAIL = "669dc63c98c09e6b8a77d4dc";

    /**
     * 销售退库
     */
    String SALES_RETURN_STOCK = "66e0f1d99525760eb07d6260";

    String SALES_RETURN_STOCK_DTL = "66e0f2b69525760eb07d6263";

    /**
     * 盘点
     */
    String INVENTORY_ORDER = "66cc2ab201b44d78708669f2";

    String INVENTORY_WORK = "66cd23c001b44d7870866ab1";

    String INVENTORY_SET = "66cd6ace01b44d7870866b1c";

    String CONTAINER_READ_REALTIME = "66a9a79498c09e6b8a77db6f";


    /**
     * 上架作业
     */
    String IN_STOCK_TASK = "6691d5c7634ce45c56c08950";

    /**
     * 仓库
     */
    String WARE_HOUSE = "668f6a91634ce45c56c0884c";

    /**
     * 库区
     */
    String STOCK_AREA = "668f6e8c634ce45c56c08863";

    /**
     * 库位
     */
    String STOCK_LOCATION = "668f6b81634ce45c56c08853";

    /**
     * 绑定容器
     */
    String BIND_CONTAINER = "6691d3cd634ce45c56c08943";

    /**
     * 容器
     */
    String CONTAINER = "668f69e9634ce45c56c08847";

    /**
     * 物料
     */
    String MATERIAL = "668f687a634ce45c56c08841";

    /**
     * erp
     */
    String ERP_WAREHOUSE = "66bdaaa28abc15745423dc85";

    String ERP_SET = "66d6c38c24db9236984f415a";

    String LOG_TABLE = "64b0b8f940680d01cc6bb113";


    String A = "a";
    String B = "b";

    static String getAbc(String materialLevelCode) {
        if(Objects.equals(materialLevelCode, MaterialLevel.A.getCode())) {
            return A;
        } else if (Objects.equals(materialLevelCode, MaterialLevel.B.getCode())) {
            return B;
        }
        return null;
    }

    @Getter
    enum OptType {
        toBind("669729517ba0581acbe7c228"),
        bind("6691d4527ba0581acbe7c1fb"),
        unbind("6691d4587ba0581acbe7c1fd"),
        ;
        private String code;
        OptType(String code) {
            this.code = code;
        }
    }

    @Getter
    enum MaterialLevel {
        A("66909bea7ba0581acbe7c1aa"),
        B("66909bed7ba0581acbe7c1ac"),
        ;
        private String code;
        MaterialLevel(String code) {
            this.code = code;
        }
    }


    @Getter
    enum DataStatus {
        effect("668f38d2889b3e051f66341c"),
        Invalidation("668f38da889b3e051f66341e"),
        delete("668f38e0889b3e051f663420"),
        ;
        private String code;
        DataStatus(String code) {
            this.code = code;
        }
    }

    @Getter
    enum InStockType {
        rawMaterialInStock("6690987f7ba0581acbe7c197"),
        productionInStock("6690988a7ba0581acbe7c199"),
        otherInStock("66a993aa7ba0581acbe7c3af"),
        // 销售退库
        salesReturnStock("66e10015b7ca811bfb9fe2ae"),
        ;
        private String code;
        InStockType(String code) {
            this.code = code;
        }
    }

    @Getter
    enum TaskStatus {
        _01("668f39a0889b3e051f663431"),
        _02("668f39a5889b3e051f663433"),
        _03("668f39ab889b3e051f663435"),
        _04("668f39b2889b3e051f663437"),
        _05("668f39b9889b3e051f663439"),
        _06("668f39be889b3e051f66343b"),
        ;
        private String code;
        TaskStatus(String code) {
            this.code = code;
        }
    }

    @Getter
    enum InStatus {
        applyOK("6694ba227ba0581acbe7c212"),
        containerBind("6694ba5c7ba0581acbe7c218"),
        inStocking("6694ba6c7ba0581acbe7c21a"),
        inStockOK("6694ba7e7ba0581acbe7c21d"),
        ;
        private String code;
        InStatus(String code) {
            this.code = code;
        }
    }

    /**
     * 容器类型
     */
    @Getter
    enum ContainerType {
        box("668f3b16889b3e051f663481"),
        partitionBox("669e2b2c7ba0581acbe7c29d"),
        partitionBox3("66bebee87ba0581acbe7c46f"),
        partitionBox4("66b30abb95ca73512562eb42"),
        spareBox("669e2baf7ba0581acbe7c2a3"),
        littleRack("668f3b1b889b3e051f663483"),
        // 大料架(4分隔)
        // bigRack4
        bigRack4("669e2b697ba0581acbe7c2a0"),
        // 中型货架(6分隔)
        lightweight6("66a72f7f7ba0581acbe7c36a"),
        productBox2("67203943db27e93bed3946aa"),
        // 混物料托盘
        mixedMaterial("67242bd6db27e93bed3946fa"),
        ;
        private String code;
        ContainerType(String code) {
            this.code = code;
        }
    }

    @Getter
    enum FlowBizType implements DictDoc {
        inOut("66a20a967ba0581acbe7c2e0"), // 出入库
        inventoryLoss("66a20aa27ba0581acbe7c2e2"), // 盘亏
        inventoryGain("66a20aaa7ba0581acbe7c2e4"), // 盘盈
        inventoryBalance("66a20ab17ba0581acbe7c2e6"), // 盘平
        ;
        private String code;
        FlowBizType(String code) {
            this.code = code;
        }
    }

    @Getter
    enum AreaCodeDict implements DictDoc {
        // B类原材料拣货入口库区编码
        bMatPickingEntrance("66b4a2bd7ba0581acbe7c424", "bMatPickingEntrance"),
        // B类原材料拣货出口库区编码
        bMatPickingExit("66b4a2c77ba0581acbe7c426", "bMatPickingExit")
        ;
        private String code;
        private String text;
        AreaCodeDict(String code, String text) {
            this.code = code;
            this.text = text;
        }
    }

    @Getter
    enum SourceType {
        sync("66b2c72695ca73512562eb31"),
        other("66b2c72e95ca73512562eb33"),
        ;
        private String code;
        SourceType(String code) {
            this.code = code;
        }
    }

    @Getter
    enum InventoryRange {
        material("66cc2c9292115726554e8ab6"),
        location("66cc2c9892115726554e8ab8"),
        ;
        private String code;
        InventoryRange(String code) {
            this.code = code;
        }
    }

    @Getter
    enum InventoryStatus implements DictDoc {
        notOut("66cd655792115726554e8ace"), // 未下架
        moving("66cd72a592115726554e8ada"), // 移动中
        out("66cd656492115726554e8ad0"), // 已下架
        checked("66cd656e92115726554e8ad2"), // 已盘点
        finished("66cd657d92115726554e8ad4"), // 已回仓
        ;
        private String code;
        InventoryStatus(String code) {
            this.code = code;
        }
    }

    @Getter
    enum AreaType {
        // 仓库存储区
        storage("668f3b3c889b3e051f66348b"),
        // CTU仓暂存区
        ctuSorting("66bad7c97ba0581acbe7c455"),
        // 立体仓暂存区
        stereoscopicSorting("66bad7d67ba0581acbe7c457"),
        // 原料发货区
        rawShipping("66bad7e97ba0581acbe7c459"),
        // 成品发货区
        prodShipping("66bad7f17ba0581acbe7c45b"),
        // 产线成品暂存区
        lineProdSide("66baf08f7ba0581acbe7c45d"),
        // 产线原料暂存区
        lineRawSide("66baf09a7ba0581acbe7c45f"),
        ;
        private String code;
        AreaType(String code) {
            this.code = code;
        }
    }

    String MANUAL_IN_OUT_BIZ = "手动出入库";
    String IN_STOCK_BIZ = "入库";
    String PRODUCT_CALL_EMPTY_BIZ = "产线呼叫空框";
    String INVENTORY_BIZ = "盘点";

    // ************* 手动出入库 start *******************************************
    String MANUAL_IN_OUT_WORK = "66c53bbb8abc15745423dd78";

    String MANUAL_IN_OUT_SET = "66c53bb28abc15745423dd76";

    String MANUAL_IN_OUT_MATERIAL = "66d515748abc15745423dfee";

    // ************* 手动出入库 end   *******************************************

    // ************* 产线 start *******************************************

    String LINE_OPERATION_SET = "66c6923d8abc15745423de08";

    String LINE_OPERATION_CALL_EMPTY_WORK = "66c7ff9d8abc15745423de46";


    // ************* 产线 end   *******************************************

    // ************* 初始化 start *******************************************

    String INIT_IN_WORK = "6710be4b3b162a5a34a8faa8";
    String INIT_CLEAR_WORK = "6711d3713b162a5a34a8fad4";
    String INIT_IN_WORK_BIZ = "初始化入库";
    String INIT_CLEAR_WORK_BIZ = "初始化清除下架";
    enum InitStatus {
        starting, running, finished
    }


    // ************* 初始化 end   *******************************************
}
